package cn.wzx.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Document("t_blogger")
public class Blogger {
    @Id
    private String id;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date tpress;    // 日期
    private String title;   // 标题
    private String digest;  // 摘要
    private String bokeId;  // 博客id
    private String typeId; // 博客类别ID
    private String uid; // 博客对应的用户ID
    private String author; // 作者
    private Integer pageviews; // 阅读量
    private Integer likenum = 0; // 点赞量
    private List<String> likeusers = new ArrayList<>(); // 点赞的用户

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getTpress() {
        return tpress;
    }

    public void setTpress(Date tpress) {
        this.tpress = tpress;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public String getBokeId() {
        return bokeId;
    }

    public void setBokeId(String bokeId) {
        this.bokeId = bokeId;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Integer getPageviews() {
        return pageviews;
    }

    public void setPageviews(Integer pageviews) {
        this.pageviews = pageviews;
    }

    public Integer getLikenum() {
        return likenum;
    }

    public void setLikenum(Integer likenum) {
        this.likenum = likenum;
    }

    public List<String> getLikeusers() {
        return likeusers;
    }

    public void setLikeusers(List<String> likeusers) {
        this.likeusers = likeusers;
    }

    @Override
    public String toString() {
        return "Blogger{" +
                "id='" + id + '\'' +
                ", tpress=" + tpress +
                ", title='" + title + '\'' +
                ", digest='" + digest + '\'' +
                ", bokeId='" + bokeId + '\'' +
                ", typeId='" + typeId + '\'' +
                ", uid='" + uid + '\'' +
                ", author='" + author + '\'' +
                ", pageviews=" + pageviews +
                ", likenum=" + likenum +
                ", likeusers=" + likeusers +
                '}';
    }
}
